﻿Public Class MoveEarsRequest
    Inherits RequestBase
    Implements IRequest

    Private _leftEarLocation As UInt32
    Private _rightEarLocation As UInt32

    Public Property LeftEarLocation() As UInt32
        Get
            Return _leftEarLocation
        End Get
        Set(ByVal value As UInt32)
            If value > 16 Then
                Throw New ArgumentOutOfRangeException("LeftEarLocation", "LeftEarLocation cannot be greater than 16")
            End If
            _leftEarLocation = value
        End Set
    End Property

    Public Property RightEarLocation() As UInt32
        Get
            Return _rightEarLocation
        End Get
        Set(ByVal value As UInt32)
            If value > 16 Then
                Throw New ArgumentOutOfRangeException("RightEarLocation", "RightEarLocation cannot be greater than 16")
            End If
            _rightEarLocation = value
        End Set
    End Property

    Public Function GetQueryString() As String Implements IRequest.GetQueryString
        Dim query As New QueryBuilder(SerialNumber, Token)
        query.SetLeftEarPosition(Me.LeftEarLocation)
        query.SetRightEarPosition(Me.RightEarLocation)
        Return query.ToString
    End Function
End Class
